package org.ww.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.ww.common.to.SkuWareStockTo;
import org.ww.common.to.mq.OrderTo;
import org.ww.common.to.mq.StockLockedTo;
import org.ww.common.utils.PageUtils;
import org.ww.ware.entity.WareSkuEntity;
import org.ww.ware.vo.WareSkuLockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author ww
 * @email ww@qq.com
 * @date 2024-01-05 15:13:15
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    PageUtils queryPageByParams(Map<String, Object> params);

    void purchaseUpdate(List<WareSkuEntity> wareSkuEntities);

    /**
     * 查询sku是否有库存
     * @param skuIds
     * @return
     */
    List<SkuWareStockTo> skuHasStock(List<Long> skuIds);

    Boolean orderLockStock(WareSkuLockVo vo);

    void stockUnLock(StockLockedTo to);

    void unLockStock(OrderTo to);
}

